def use_len_count():
    name_list=['王小美', 'zhangsan', '李四', '王小二', '孙悟空', '猪八戒']
    print(len(name_list))
    count=name_list.count('zhangsan')
    print(count)
def use_sort():
    name_list = ['王小美', 'zhangsan', '李四', '王小二', '孙悟空', '猪八戒']
    num_list=[6,8,4,1,10]
    name_list.sort()
    num_list.sort(reverse=True)
    # 降序
    print(name_list)
    print(num_list)
use_sort()
# 反转
def use_reverse():
    name_list = ['王小美', 'zhangsan', '李四', '王小二', '孙悟空', '猪八戒']
    num_list = [6, 8, 4, 1, 10]
    name_list.reverse()
    num_list.reverse()
    print(name_list)
    print(num_list)
use_reverse()
def use_iter():
    name_list = ['王小美', 'zhangsan', '李四', '王小二', '孙悟空', '猪八戒']
    for name in name_list:
        print(name,end=' ')
        print()
        i=0
        while i < len(name_list):
            print(name_list[i],end=' ')
            i+=1
use_iter()